package org.xq.shop.maxaishop.util;

import java.io.FileWriter;
import java.io.IOException;

/**
 * @author maozhongjin
 * @date 2021/8/13 9:14
 */
public class AlipayConfigInfo {
    // ↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id="2021000118602179";//例：2016082600317257
    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDT+MFrjyIx58BZuPaiG2hYFbU3uZQdKkzNJZPZg4TjVT8tjshbq0EFWfSjc+g5SBTQMwv6yBYDzpm975w4qNWtQFcYxebk8/avXBTQE17o2sICDj/oTUZuOEv2PCpbEeo3sPZ/muX6eTWvLEIBRUlAyr4V0gf7/WF6urZMZUt/IvqR/NwU7wULmOO3KGmgZeaDv4+5hoiCJqSLIlVCIZmTSjnf/EJoZs7o8U3RGCYkqBUQ0VzOf2k51z0Eh/OGR39fdR+T3v6+Wz/CfmDTUBZiiusHQs2CXN5mgR2xB0EyNNV93f8m141Vx1VnP21BDVNANkOEREzNXAJQzlA1QywPAgMBAAECggEBAIKUFvLfdb0wernKy4QJRjodBUmStL9Ss4UcxPuVnWM9vHGgJ6Tw1lkplR6r5D6FPO0UxShz4bvupZ7v4Fi3CQp1PDIyl44rC6fzHY8gn7LqL+F8TboZAG4dmA3T+nOnkZVFGlR5Y3rs+Dk1FmQZ/oo/WuGuROTirg4gvvRI4j0qeuApQpFhfXnG0kfPK+oJ66PqIRc1udRVYalBt0NFzjUdhyFHNi9+3y59WBckQFbzJ5aHggXCJZ4XsuywP+GRN/SbRWtunk8wdDuleDokxLJOBRX7XOBcTJRPzmnjyTz2DNPnmEcZBITf795k77xnDPWQagVkPuLCeCiGz+ot6KECgYEA/2vUSR8k2DRVBlj5Eo0W8GHRbc6G1lLxaU4KEIwZTBhNAtU5Lhet+qPt4zAN2zQ9S7PlE0wC/iWUmBdQq792p5QJ4xVdRBFQJHtbu9c329g2HWRPsiXttHhS/QOFGKERL9molCTJZKO3LmDutt70cWv+KdhOzd2NIRzvtjk8laUCgYEA1HO4mXzAd8vmbEcro4PjWzJn2TdGtX55zaYhrNmPj2IbzXV0OclL2RSDiidQzunm2gq5QETmnyzuZ1CSiW7Lm7iHDEKFN+mYaefu2gyGNv7JOnlTBA2e16U0hwldAWzmADrK8DQKLeIZjszCTgbYRWeTcGfRC70/tMVj1h3TFKMCgYA/IyBuksxAxW7fCs9GzqmE8ikaw5qBEC+soCXMwVTfgoJG2P4xbpkLA8qiBhbmwJsGQ4m0o2159UAt+FVwnvttoSJwh69uS/lLi1K5tBGSvndh/JHWr5l6quOYt24HEIl3Eo6hUBaYUf/N7xgTDDnQb6l8HoQcT0+7h7OZj7xyIQKBgAyHepaKtesauk8eb2NoTss9EMTNrrzbZaGML6Y6+m1xUsRuLdmOlouJ2ywVn31ka/nl8gDpT1SJ2NF8/fde8mEPo99EOQkQHK36QKrZXDz4D7QEHbI6f2imVI+2LKb93h6bWQaLeyIzmGBEkRz66FxHfHl/leOEWLJ3hajF/4HTAoGAVBWHxkQTlX/qAuWorIuLtS0/NRi1N/3FYvnNKtFljf/iFQh/MqDTs+nZFTx5qDY4e1h+CYnb9VFeIx2Hhw3nv2ZfCn24uDS7zHEvxmIe88ZH6jzznTZrbDRMJeHG84U5gCvDX5SU/QzgFA3SSwf2twlFhtBrf0BCwqbXrx6c/Ys=";
    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm
    // 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAhqvgkdPeiEW9hsIIX6FagsWTMCkK2PkJHc7eGM+jISsjo8otns1Y5FfKz+SS6bu7VrF7pqm4TpdPGvwJNAuZi7CrDvceEVevQOSih3SEdXMqLuFAXgwEKt9p8TrNoDA0vbDjxfoMycjnjIJzhpGq77Y/6Zs5NOwxqPiAFuCzT8V9DCOow9Va4ZWX2SEGr9L4GwU3nVKruQX7pvORNInIE+x0i5lzp/JQF1enYb/3GQYoAsiAqQMH/xMSKuWVDoRLOpnEeawUX8rDkyJV4Npsu6XT4Hyu7Hh5ES7VKwmH0xbuZmx7CAJ4jYe+aTUxFuF7VyzcJHNjw2Smx8O4QzCvXQIDAQAB";
    // 服务器异步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    /**
     * 返回的时候此页面不会返回到用户页面，只会执行你写到控制器里的地址
     */
    public static String notify_url="http://nb2xq5w.nat.ipyingshe.com/xqCorder/notifyInfo";
    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    /**
     * 此页面是同步返回用户页面，也就是用户支付后看到的页面，上面的notify_url是异步返回商家操作，谢谢
     * 要是看不懂就找度娘，或者多读几遍，或者去看支付宝第三方接口API，不看API直接拿去就用，遇坑不怪别人,要使用外网能访问的ip,建议使用花生壳,内网穿透
     */
    public static String return_url = "http://127.0.0.1:8848/myshop/user.html";
    // 签名方式
    public static String sign_type = "RSA2";
    // 字符编码格式
    public static String charset = "utf-8";
    // 支付宝网关
    public static String gatewayUrl= "https://openapi.alipaydev.com/gateway.do";
    // 日志地址,这里在d盘下要创建这个文件,不然会报错
    public static String log_path = "D:/logs/";
//    public static String notify_url;
    // ↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     *
     * @param sWord
     *            要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_"
                    + System.currentTimeMillis() + ".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
